import request from '@/utils/request'

// 修改车辆状态
export function updateState(data) {
    return request({
        url: '/cockpit/state',
        method: 'put',
        data: data
    })
}

export function getCarState(carId) {
    return request({
        url: '/cockpit/state/byCarId/' + carId,
        method: 'get'
    })
}

export function turnmove(carId) {
    return request({
        url: '/cockpit/control/move/' + carId,
        method: 'post',
    })
}

export function turnleft(carId) {
    return request({
        url: '/cockpit/control/left/' + carId,
        method: 'post',
    })
}

export function turnright(carId) {
    return request({
        url: '/cockpit/control/right/' + carId,
        method: 'post',
    })
}

export function turnback(carId) {
    return request({
        url: '/cockpit/control/back/' + carId,
        method: 'post',
    })
}

export function stop(carId) {
    return request({
        url: '/cockpit/control/stop/' + carId,
        method: 'post',
    })
}

// 修改车灯
export function updateLight(data) {
    return request({
        url: '/cockpit/control/light',
        method: 'post',
        data: data
    })
}

// 修改车门
export function updateDoor(data) {
    return request({
        url: '/cockpit/control/door',
        method: 'post',
        data: data
    })
}